package acm.蓝桥5;

import java.util.Scanner;

public class 螺旋线 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        if (x == 0 && y == 0) {
            System.out.println(0);
            return;
        }
        int absX = Math.abs(x);
        int absY = Math.abs(y);
        int n = Math.max(absX, absY);
        long res;
        if (x >= 0 && y >= 0) {   //第一象限
            res = leftOrDown(n) * 2 + rightOrUp(n)+ rightOrUp(n-1) + x - y;
        } else if (x > 0) {
            res = leftOrDown(n) * 2 + rightOrUp(n) * 2 + absY - absX;
        } else if (y < 0) { //第三象限
            res = leftOrDown(n - 1) + leftOrDown(n) + rightOrUp(n - 1) * 2 + (absX - 1) - absY;
        } else {
            res = leftOrDown(n) * 2 + rightOrUp(n - 1) * 2 + absY - absX;
        }
        System.out.println(res);
    }

    public static long leftOrDown(int n) {
        return n + (long) (n - 1) * n;
    }

    public static long rightOrUp(int n) {
        return 2L * n + (long) (n - 1) * n;
    }
}
